﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// NotReviewedButNeeded
#pragma once

#include "GcmpLocatorCommands.h"

namespace gcmp
{
    class IAction;
    class IUiView;
    class Vector3d; 
    class ISnap;
    class IGraphicsNodeGroup;
    class Coordinate3d;
    class IDocument;
    class IElementLocator;

    /// \brief 罗盘操作Action的Behavior，方便定制罗盘Action的行为。
    class IActionLocatorBehavior
    {
    public:
        /// \brief 析构函数
        virtual ~IActionLocatorBehavior(){}


    public:
        /// \brief 回调函数
        ///
        /// \param pCurrentView    当前Ui视图
        /// \param pickedPt  Pick到的点(射线与捕捉参照平面的交点)
        /// \param mousePt   鼠标点
        typedef std::function<void(gcmp::IUiView* pCurrentView, const gcmp::Vector3d& pickedPt, const gcmp::Vector3d& mousePt)> MoveCallback;


        /// \brief 获取罗盘的拾取点交互对象。
        ///  如需使用平台内置输入框进行视图输入，必须派生 IPickPointActionOutputData 类，进行视图输入的传递，否则视图输入无效
        /// \param startPoint 拾取点的交互起点
        /// \param pPoickedPoint 父交互对象的拾取点指针，用于返回拾取到的点
        /// \param pPickedPoints 父交互对象的拾取到的点集合指针，返回交互过程所有拾取到的点，含（除当前pPoickedPoint的所有拾取到的点）
        /// \param pSnap             拾取过程中，返回捕捉结果
        /// \param moveCallback 拾取过程中，移动鼠标动态预览，传递父交互对象的预览方法地址，实现过程预览效果
        /// \return 返回拾取点的交互对象。
        virtual OwnerPtr<IAction> GetPickPointAction(const Vector3d& startPoint, Vector3d* pPoickedPoint, std::vector<Vector3d>* pPickedPoints, 
            OwnerPtr<ISnap>* pSnap,
            MoveCallback moveCallback) = 0;

        /// \brief 获取罗盘的预览对象节点组
        /// 
        /// \param pCurrentDoc    当前文档
        /// \param pLocator       正在操作的罗盘
        /// \param startPoint     罗盘操作起始点
        /// \param endPoint       罗盘操作终点
        /// \param coord          工作平面坐标系
        /// \param pSnapResult    捕捉结果
        /// \return 需要显示的预览节点组
        virtual OwnerPtr<gcmp::IGraphicsNodeGroup> GetPreviewGroup(gcmp::IDocument* pCurrentDoc, const IElementLocator *pLocator ,const Vector3d &startPoint,const  Vector3d &endPoint , const Coordinate3d& coord ,const ISnap* pSnapResult) = 0;
    };
}
